Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/item buffer #4

Merged
merged 10 commits into from
Dec 14, 2023
Merged

Feat/item buffer #4

merged 10 commits into from
Dec 14, 2023

Conversation

EdanToledo
Copy link
Contributor

What?

Adds a simple wrapper for the trajectory buffer much like the flat buffer.

Why?

A lot of users seem to require a buffer for completely independent data items. This can be easily achieved by using a trajectory buffer with a period of 1 and sequence length of 1 however it requires removing the time dimension every time a user samples a batch and adding a time dimension every time a user adds a batch.

How?

The wrapper provides the same utility as the flat buffer allowing users to choose whether they add batches, sequences or both. Additionally, since data items are completely independent, all data is flattened along the batch dimension thus allowing a user to specify an exact buffer size which is not possible when using the square structure of the trajectory buffer normally.

Copy link
Contributor

@callumtilbury callumtilbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just changing the language in some sections—using the word 'items' instead of 'transitions.'

flashbax/buffers/item_buffer.py Outdated Show resolved Hide resolved
flashbax/buffers/item_buffer.py Outdated Show resolved Hide resolved
flashbax/buffers/item_buffer.py Outdated Show resolved Hide resolved
flashbax/buffers/item_buffer.py Outdated Show resolved Hide resolved
flashbax/buffers/item_buffer.py Outdated Show resolved Hide resolved
flashbax/buffers/item_buffer.py Outdated Show resolved Hide resolved
@callumtilbury
Copy link
Contributor

We should add the item buffer to the README too :)

EdanToledo and others added 7 commits December 14, 2023 10:15
Co-authored-by: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com>
Co-authored-by: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com>
Co-authored-by: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com>
Co-authored-by: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com>
Co-authored-by: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com>
Co-authored-by: Callum Tilbury <37700709+callumtilbury@users.noreply.github.com>
Copy link
Contributor

@callumtilbury callumtilbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely stuff! Cheers @EdanToledo

@callumtilbury callumtilbury merged commit 1d45803 into main Dec 14, 2023
1 of 3 checks passed
@callumtilbury callumtilbury deleted the feat/item_buffer branch December 14, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants